package singleton_pattern;



public class SingleObject {
    private volatile static SingleObject singleton;

    private SingleObject() {
    }

    public static SingleObject getSingleton() {
        if (singleton == null) {
            synchronized (SingleObject.class) {
                if (singleton == null) {
                    singleton = new SingleObject();
                }
            }
        }
        return singleton;
    }
}
